package com.conversationboard.model;

import java.io.IOException;
import java.net.UnknownHostException;
import java.util.Date;

import com.conversationboard.dns.DNS;

public class PendingRegistration {

    private String displayName;
    private String loginId;
    private String hash;
    private String password;
    private String ipAddress;
    private String domainName;
    private Date registrationTime;
    private String timeZone;


    public String getDisplayName() {
        return displayName;
    }


    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }


    public String getHash() {
        return hash;
    }


    public void setHash(String hash) {
        this.hash = hash;
    }


    public String getLoginId() {
        return loginId;
    }


    public void setLoginId(String loginId) {
        this.loginId = loginId;
    }


    public String getTimeZone() {
        return timeZone;
    }


    public void setTimeZone(String timeZone) {
        this.timeZone = timeZone;
    }


    public String getIpAddress() {
        return ipAddress;
    }


    public void setIpAddress(String ipAddress) throws IOException {

        this.ipAddress = ipAddress;

        /* Lookup domain name */

        try {
            this.setDomainName(DNS.dnsLoopup(ipAddress));
        } catch (UnknownHostException e) {
        }

    }


    public String getDomainName() {
        return domainName;
    }


    public void setDomainName(String domainName) {
        this.domainName = domainName;
    }


    public Date getRegistrationTime() {
        return registrationTime;
    }


    public void setRegistrationTime(Date registrationTime) {
        this.registrationTime = registrationTime;
    }


    public String getPassword() {
        return password;
    }


    public void setPassword(String password) {
        this.password = password;
    }

}
